| Conditions | 4 |
| Total Lines | 19 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | interface SubmitButton extends HTMLElement { |
||
| 10 | |||
| 11 | const checkValidText = (event: Event): void => { |
||
| 12 | const bilInformasjon = event.target as HTMLInputElement; |
||
| 13 | |||
| 14 | const submitButton = window.document.getElementById( |
||
| 15 | "submitButton" |
||
| 16 | ) as SubmitButton; |
||
| 17 | |||
| 18 | const letters = /[A-Z]{2}\d{5}/gi; |
||
| 19 | const bilInformasjonMatchesFormat = letters.test(bilInformasjon.value); |
||
| 20 | |||
| 21 | if ( |
||
| 22 | bilInformasjonMatchesFormat && |
||
| 23 | bilInformasjon !== undefined |
||
| 24 | |||
| 25 | //bilInformasjon.length === 7 |
||
| 26 | ) { |
||
| 27 | submitButton.removeAttribute("disabled"); |
||
| 28 | } else { |
||
| 29 | submitButton.setAttribute("disabled", "true"); |
||
| 34 |